.option push
.option norvc
.option norelax


.section .vectors, "ax"
.balign 256
.global _vector_table
_vector_table:
    jal x0, exception_handler
    .rept 2
    jal x0, default_exc_handler
    .endr
    jal x0, software_handler

    .rept 3
    jal x0, default_exc_handler
    .endr
    jal x0, timer_handler

    .rept 3
    jal x0, default_exc_handler
    .endr
    jal x0, external_handler

    .rept 3
    jal x0, default_exc_handler
    .endr
    jal x0, nmi_handler

    jal x0, fast_irq0_handler
    jal x0, fast_irq1_handler
    jal x0, fast_irq2_handler
    jal x0, fast_irq3_handler
    jal x0, fast_irq4_handler
    jal x0, fast_irq5_handler
    jal x0, fast_irq6_handler
    jal x0, fast_irq7_handler
    jal x0, fast_irq8_handler
    jal x0, fast_irq9_handler
    jal x0, fast_irq10_handler
    jal x0, fast_irq11_handler
    jal x0, fast_irq12_handler
    jal x0, fast_irq13_handler
    jal x0, fast_irq14_handler
    jal x0, fast_irq15_handler
.option pop



//#define PLIC_VEC
#ifdef PLIC_VEC
.option push
.option norvc
.option norelax
.section .vectors, "ax"
.balign 1024
.global _ext_vector_table
_ext_vector_table:
    jal x0, default_exc_handler         /* 0*/
    jal x0, timer0_intr_handler         /* 1*/
    jal x0, timer1_intr_handler         /* 2*/
    jal x0, timer2_intr_handler         /* 3*/
    jal x0, timer3_intr_handler         /* 4*/
    jal x0, timer4_intr_handler         /* 5*/
    jal x0, timer5_intr_handler         /* 6*/
    jal x0, timer6_intr_handler         /* 7*/
    jal x0, timer7_intr_handler         /* 8*/
    jal x0, assi0_intr_handler          /* 9*/
    jal x0, assi1_intr_handler          /*10*/
    jal x0, assi2_intr_handler          /*11*/
    jal x0, assi3_intr_handler          /*12*/
    jal x0, assi4_intr_handler          /*13*/
    jal x0, assi5_intr_handler          /*14*/
    jal x0, i2s_intr_handler            /*15*/
    jal x0, iwdt_intr_handler           /*16*/
    jal x0, rtc_intr_handler            /*17*/
    jal x0, DMAC0_IRQHandler            /*18*/
    jal x0, ewm_intr_handler            /*19*/
    jal x0, lpitimer0_intr_handler      /*20*/
    jal x0, lpitimer1_intr_handler      /*21*/
    jal x0, lpitimer2_intr_handler      /*22*/
    jal x0, lpitimer3_intr_handler      /*23*/
    jal x0, cpuwakeup_intr_handler      /*24*/
    jal x0, qei0_intr_handler           /*25*/
    jal x0, gpioa_intr_handler          /*26*/
    jal x0, gpiob_intr_handler          /*27*/
    jal x0, gpioc_intr_handler          /*28*/
    jal x0, gpiod_intr_handler          /*29*/
    jal x0, default_exc_handler         /*30*/
    jal x0, qei1_intr_handler           /*31*/
    jal x0, lpi2c_intr_handler          /*32*/
    jal x0, lpspi_intr_handler          /*33*/
    jal x0, eflash_intr_handler         /*34*/
    jal x0, default_exc_handler         /*35*/
    jal x0, default_exc_handler         /*36*/
    jal x0, default_exc_handler         /*37*/
    jal x0, mpu_err_intr_handler        /*38*/
    jal x0, erm_intr_handler            /*39*/
    jal x0, lptimer0_intr_handler       /*40*/
    jal x0, lptimer1_intr_handler       /*41*/
    jal x0, lptimer2_intr_handler       /*42*/
    jal x0, clk_fault_intr_handler      /*43*/
    jal x0, luart_intr_handler          /*44*/
    jal x0, bor_intr_handler            /*45*/
    jal x0, CAN0_IRQHandler           /*46*/
    jal x0, CAN1_IRQHandler           /*47*/
    jal x0, CAN2_IRQHandler           /*48*/
    jal x0, default_exc_handler         /*49*/
    jal x0, default_exc_handler         /*50*/
    jal x0, mtu0_tgia0_handler          /*51*/
    jal x0, mtu0_tgib0_handler          /*52*/
    jal x0, mtu0_tgic0_handler          /*53*/
    jal x0, mtu0_tgid0_handler          /*54*/
    jal x0, mtu0_tgiv0_handler          /*55*/
    jal x0, mtu0_tgie0_handler          /*56*/
    jal x0, mtu0_tgif0_handler          /*57*/
    jal x0, mtu0_tgia1_handler          /*58*/
    jal x0, mtu0_tgib1_handler          /*59*/
    jal x0, mtu0_tgiv1_handler          /*60*/
    jal x0, mtu0_tgiu1_handler          /*61*/
    jal x0, mtu0_tgia2_handler          /*62*/
    jal x0, mtu0_tgib2_handler          /*63*/
    jal x0, mtu0_tgiv2_handler          /*64*/
    jal x0, mtu0_tgiu2_handler          /*65*/
    jal x0, mtu0_tgia3_handler          /*66*/
    jal x0, mtu0_tgib3_handler          /*67*/
    jal x0, mtu0_tgic3_handler          /*68*/
    jal x0, mtu0_tgid3_handler          /*69*/
    jal x0, mtu0_tgiv3_handler          /*70*/
    jal x0, mtu0_tgia4_handler          /*71*/
    jal x0, mtu0_tgib4_handler          /*72*/
    jal x0, mtu0_tgic4_handler          /*73*/
    jal x0, mtu0_tgid4_handler          /*74*/
    jal x0, mtu0_tgiv4_handler          /*75*/
    jal x0, mtu0_tgiu5_handler          /*76*/
    jal x0, mtu0_tgiv5_handler          /*77*/
    jal x0, mtu0_tgiw5_handler          /*78*/
    jal x0, mtu0_tgia6_handler          /*79*/
    jal x0, mtu0_tgib6_handler          /*80*/
    jal x0, mtu0_tgic6_handler          /*81*/
    jal x0, mtu0_tgid6_handler          /*82*/
    jal x0, mtu0_tgiv6_handler          /*83*/
    jal x0, mtu0_tgia7_handler          /*84*/
    jal x0, mtu0_tgib7_handler          /*85*/
    jal x0, mtu0_tgic7_handler          /*86*/
    jal x0, mtu0_tgid7_handler          /*87*/
    jal x0, mtu0_tgiv7_handler          /*88*/
    jal x0, pdb0_intr_handler           /*89*/
    jal x0, pdb1_intr_handler           /*90*/
    jal x0, default_exc_handler         /*91*/
    jal x0, default_exc_handler         /*92*/
    jal x0, default_exc_handler         /*93*/
    jal x0, default_exc_handler         /*94*/
    jal x0, default_exc_handler         /*95*/
    jal x0, adc0_smaple_handler         /*96*/
    jal x0, adc1_smaple_handler         /*97*/
    jal x0, adc0_arbitration_handler    /*98*/
    jal x0, adc1_arbitration_handler    /*99*/
    jal x0, iin0_intr_handler           /*100*/
    jal x0, iin1_intr_handler           /*101*/
    jal x0, lptimer_intr_handler        /*102*/
    jal x0, intc_adc1_handler           /*103*/
    jal x0, hsm_intr_handler            /*104*/
    jal x0, intc_cmp_handler            /*105*/
    jal x0, intc_adc0_handler           /*106*/
    jal x0, adc0_ts_irq_handler         /*107*/
    jal x0, adc0_ts_irqh_handler        /*108*/
    jal x0, adc0_ts_irql_handler        /*109*/
    jal x0, adc1_ts_irq_handler         /*110*/
    jal x0, adc1_ts_irqh_handler        /*111*/
    jal x0, adc1_ts_irql_handler        /*112*/
    jal x0, poen_oei1_irq_handler       /*113*/
    jal x0, poen_oei2_irq_handler       /*114*/
    jal x0, poen_oei3_irq_handler       /*115*/
    jal x0, cmp_intr_handler            /*116*/
    jal x0, cmu_intr_handler            /*117*/
    jal x0, pllloss_intr_handler        /*118*/
    .rept 137
    jal x0, default_exc_handler         /*119-255*/
    .endr
.option pop
#endif